ARG DOCKER_REGISTRY=docker.io
FROM ${DOCKER_REGISTRY}/openjdk:11.0.14.1-jdk-bullseye
ARG JAR_NAME=datascience-web-1.0.1-SNAPSHOT.jar
ENV TZ=Asia/Shanghai
RUN sed -i -E 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
    && sed -i -E 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
    && apt update && apt-get install -y findutils postgis

RUN useradd spring
COPY --chown=spring entry-point.sh /app/bin/
COPY --chown=spring ${JAR_NAME} /app/
RUN chmod 744 /app/bin/entry-point.sh \
    && ln -s /app/${JAR_NAME} /app/application.jar
USER spring
WORKDIR /app
CMD ["/app/bin/entry-point.sh"]
